<!DOCTYPE html>
<html lang="en">

<head>
<title>APS - Advanced planning system</title>

<meta http-equiv="Content-Type" content="text/html" charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<!--[if lt IE 8]> 
    <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script> 
<![endif]-->
<!--[if lt IE 7]> 
    <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE7.js"></script> 
<![endif]-->
        
<link rel="stylesheet" href="{{ asset('bundles/easydisAPS/css/css-template/bootstrap.min.css') }}" />
<link rel="stylesheet" href="{{ asset('bundles/easydisAPS/css/css-template/bootstrap-responsive.min.css') }}"/>
<link rel="stylesheet" href="{{ asset('bundles/easydisAPS/css/css-template/maruti-style.css') }}" />
<link rel="stylesheet" href="{{ asset('bundles/easydisAPS/css/css-template/maruti-media.css') }}" class="skin-color" />

<link rel="shortcut icon" href="{{ asset('bundles/easydisAPS/images/favicon.ico') }}" />
<script src="{{ asset('bundles/easydisAPS/js-template/jquery.min.js') }}"></script>
<script src="{{ asset('bundles/easydisAPS/js-template/jquery.ui.custom.js') }}"></script> 
<script src="{{ asset('bundles/easydisAPS/js-template/bootstrap.min.js') }}"></script> 
<script src="{{ asset('bundles/easydisAPS/js-template/jquery.gritter.min.js') }}"></script> 
<script src="{{ asset('bundles/easydisAPS/js-template/jquery.peity.min.js') }}"></script>

<style type="text/css">    
	table {
		overflow:hidden;
		border:1px solid #d3d3d3;
		background:#fefefe;
		width:100%;
		/*margin:5% auto 0;*/
		-moz-border-radius:5px; /* FF1+ */
		-webkit-border-radius:5px; /* Saf3-4 */
		border-radius:5px;
		-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
		-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
	}
	
	th {padding:18px 28px 18px; text-align:center; }
        
        td {padding:5px 5px 5px; text-align:center; }
	
	th {padding-top:18px; text-shadow: 1px 1px 1px #fff; background:#e8eaeb; color: #000;}
	
	td {border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;}
	
	tr.odd-row td {background:#f6f6f6;}
	
	td.first, th.first {text-align:left}
	
	td.last {border-right:none;}
	

	/*
        td {
		background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);
		background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));
	}*/
	
	tr.odd-row td {
		background: -moz-linear-gradient(100% 25% 90deg, #f6f6f6, #f1f1f1);
		background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f1f1f1), to(#f6f6f6));
	}
	
	th {
		background: -moz-linear-gradient(100% 20% 90deg, #e8eaeb, #ededed);
		background: -webkit-gradient(linear, 0% 0%, 0% 20%, from(#ededed), to(#e8eaeb));
	}
	

	
	tr:first-child th.first {
		-moz-border-radius-topleft:5px;
		-webkit-border-top-left-radius:5px; /* Saf3-4 */
	}
	
	tr:first-child th.last {
		-moz-border-radius-topright:5px;
		-webkit-border-top-right-radius:5px; /* Saf3-4 */
	}
	
	tr:last-child td.first {
		-moz-border-radius-bottomleft:5px;
		-webkit-border-bottom-left-radius:5px; /* Saf3-4 */
	}
	
	tr:last-child td.last {
		-moz-border-radius-bottomright:5px;
		-webkit-border-bottom-right-radius:5px; /* Saf3-4 */
	}
        
        .larger { 
            width: 500px;
        }
        
        td.cat {
            background-color: #e7eaeb;
            font-weight: bold;
            color: #000;
        }
</style>  

</head>
<body>


<table>
    <thead>
    <tr>
        <th class="larger">Semaine {{ num_semaine }}</th>
        <th>Lundi <i>{{ tabdates[0] }}</i></th>
        <th>Mardi <i>{{ tabdates[1] }}</i></th>
        <th>Mercredi <i>{{ tabdates[2] }}</i></th>
        <th>Jeudi <i>{{ tabdates[3] }}</i></th>
        <th>Vendredi <i>{{ tabdates[4] }}</i></th>
        <th>Samedi <i>{{ tabdates[5] }}</i></th>
        <th>Dimanche <i>{{ tabdates[6] }}</i></th>
    </tr>
    </thead>
    <tbody> 
    {% for affect in planning %}
        {% if affect[0][0] is not null %}
            {% if affect[0][0][1] == "Lib" %}
                <tr>
                    <td>Service [{{ affect[0][0][0] }}]</td>
                    <td colspan="7"></td>
                </tr>
            {% else %}
            <tr>
                <td class="larger" rowspan="2"><h5>{% if affect[0][0][1] is not null %} <a href="{{ path('easydisAPSBundle_planning_modifsalaries', {'date':date, 'gs':gs, 'idsal':affect[0][0][1].id}) }}">{% endif %}{{ affect[0][0][0] }}</a></h5></td>

                {% set strs = affect[0][1]|split('/')%}
                {% set colors = affect[0][3]|split('/')%}
                <td><span style="color: {{ colors[0] }}">{{ strs[0] }}</span>{% if strs|length > 1 %} <span style="color: {{ colors[1] }}">{{ strs[1] }}</span> {% endif %}</td>

                {% set strs = affect[1][1]|split('/')%}
                {% set colors = affect[1][3]|split('/')%}
                <td><span style="color: {{ colors[0] }}">{{ strs[0] }}</span>{% if strs|length > 1 %} <span style="color: {{ colors[1] }}">{{ strs[1] }}</span> {% endif %}</td>

                {% set strs = affect[2][1]|split('/')%}
                {% set colors = affect[2][3]|split('/')%}
                <td><span style="color: {{ colors[0] }}">{{ strs[0] }}</span>{% if strs|length > 1 %} <span style="color: {{ colors[1] }}">{{ strs[1] }}</span> {% endif %}</td>

                {% set strs = affect[3][1]|split('/')%}
                {% set colors = affect[3][3]|split('/')%}
                <td><span style="color: {{ colors[0] }}">{{ strs[0] }}</span>{% if strs|length > 1 %} <span style="color: {{ colors[1] }}">{{ strs[1] }}</span> {% endif %}</td>

                {% set strs = affect[4][1]|split('/')%}
                {% set colors = affect[4][3]|split('/')%}
                <td><span style="color: {{ colors[0] }}">{{ strs[0] }}</span>{% if strs|length > 1 %} <span style="color: {{ colors[1] }}">{{ strs[1] }}</span> {% endif %}</td>

                {% set strs = affect[5][1]|split('/')%}
                {% set colors = affect[5][3]|split('/')%}
                <td><span style="color: {{ colors[0] }}">{{ strs[0] }}</span>{% if strs|length > 1 %} <span style="color: {{ colors[1] }}">{{ strs[1] }}</span> {% endif %}</td>

                {% set strs = affect[6][1]|split('/')%}
                {% set colors = affect[6][3]|split('/')%}
                <td><span style="color: {{ colors[0] }}">{{ strs[0] }}</span>{% if strs|length > 1 %} <span style="color: {{ colors[1] }}">{{ strs[1] }}</span> {% endif %}</td>
            </tr>
            <tr>
                <td>{{ affect[0][2] }}</td>
                <td>{{ affect[1][2] }}</td>
                <td>{{ affect[2][2] }}</td>
                <td>{{ affect[3][2] }}</td>
                <td>{{ affect[4][2] }}</td>
                <td>{{ affect[5][2] }}</td>
                <td>{{ affect[6][2] }}</td>
            </tr>
            {% endif %}
        {% endif %}
    {% endfor %}
    </tbody>
</table>
</body>